menutracker: reduce allocations and signal emission
authorChristian Hergert <chergert@redhat.com>
Wed, 8 Dec 2021 06:33:20 +0000 (22:33 -0800)
committerChristian Hergert <chergert@redhat.com>
Wed, 8 Dec 2021 06:42:04 +0000 (22:42 -0800)
commit00d5f72d6ea125cd64013c1770d38cd083d0c8f8
tree82a21a45c3a21ac40e40e10841a6d1300dd37571
parent348e34f2218d9ddd795734719235786db653ec2d
menutracker: reduce allocations and signal emission

When handling action-added callbacks the code was previously using a
freeze_notify/thaw_notify in all cases. This turns out to allocate a
significant amount of memory when called a lot.

That said, it shouldn't be getting called this much but given the current
state of affairs elsewhere in GtkActionMuxer, this brought temporary
allocations down from 9MiB to 9KiB in gnome-text-editor after showing
the context menu a few times.

Related #4422
gtk/gtkmenutrackeritem.c